package com.util;
/**
 * 读版本响应
 * @author LiuYaDong
 *
 */
public class ReadVersionResponse {
	private static final String cmdcode = "DF";
	private String status = "";
	private String equiptmentLen = "";
	private String equiptmentMessage = "";
	private CMD_55AA cmd = null;

	private ReadVersionResponse(){}
	public static ReadVersionResponse disassemble(String cmdstr) {
		ReadVersionResponse io = new ReadVersionResponse();
		io.cmd = CMD_55AA.disassemble(cmdstr);
		if(io.cmd == null)return null;
		if(!io.cmd.getCMD().equals(cmdcode))return null;
		if(io.cmd.getDATA().length() < 14)return null;
		io.status = io.cmd.getDATA().substring(2,4) ;
		io.equiptmentLen = io.cmd.getDATA().substring(4,6) ;
		io.equiptmentMessage =io.cmd.getDATA().substring(6) ;
		return io;
	}
	public String getStatus() {
		return status;
	}
	public String getEquiptmentLen() {
		return equiptmentLen;
	}
	public String getEquiptmentMessage() {
		return equiptmentMessage;
	}


}
